#pragma once
#include "Effect.h"
namespace mini
{
	class CProjectView : public CEffect
	{
	public:
		CProjectView();
		virtual ~CProjectView();
		virtual void commitToGpu(DeviceContext* pDeviceContext) override;

		void setViewPoint(const CPoint3F& pt);
		void setLookAt(const CPoint3F& pt);
		void setProjectionParameters(float fieldOfView, float aspectRatio, float nearPlane, float farPlane);
		void setProjectTexture(const std::string& szTexture, int nSlot);
		void setProjectTexture(CTexture* pTexture, int nSlot);

		CMatrix& getViewMatrix();
		CMatrix& getProjectMatrix();

	private:
		bool		mbDirty = true;
		CMatrix		mViewMatrix;
		CMatrix		mProjectMatrix;
		CMatrix		mMatrices[2];
		CPoint3F	m_viewPt;
		CPoint3F	m_lookAtPt;
		float m_fieldOfView;
		float m_aspectRatio;
		float m_nearPlane;
		float m_farPlane;
	};

}